package com.itholmes.service;

import com.itholmes.dao.UserDaoSelectOne;
import com.itholmes.pojo.Result;
import com.itholmes.pojo.User;

public class UserSelectOneService implements UserService{

	public Result matchUser(User user) {
		
		UserDaoSelectOne selectOne = new UserDaoSelectOne();
		User user2 = selectOne.getSelectNameOne(user.getUser_name());
		
		Result result = new Result();
		
		if(user.getUser_password().equals(user2.getUser_password())) {
			result.setCode(1);
			result.setComment("密码正确，登录成功！");
			result.setData(user2);
		}else {
			result.setCode(0);
			result.setComment("密码错误，请重新登录！");
		}
		
		return result;
	}

}
